home *** CD-ROM | disk | FTP | other *** search
/ BCI NET / BCI NET Dec 94.iso / archives / applications / wp / macro.lha / Macro / AUGFL / UUInsert.ged < prev    next >
Text File  |  1994-07-03  |  2KB  |  83 lines

  1. /************************************************************
  2.      UUInsert written by Francois Helsen and Lieven Lema
  3.                     for use with GoldEd
  4.           No need to check for compression anymore
  5.          Install as 'UUWrite...' in the ARexx menu.
  6.  
  7.                         First release
  8.                    UUInsert.ged 1.0  (20.04.94)
  9.  
  10.                       LHA-routine added
  11.                    UUInsert.ged 1.01 (22.04.94)
  12.                    UUInsert.ged 1.1  (23.04.94)
  13.  
  14.                       name routine added    
  15.                    UUInsert.ged 1.2  (23.04.94)
  16.                    UUInsert.ged 1.3  (24.04.94)
  17.  
  18.                    Minor bugfix: DO without END
  19.              $VER: UUInsert.ged 1.31 (02.07.94)
  20. ************************************************************/
  21.  
  22. OPTIONS RESULTS                          /* enable return codes        */
  23. 'LOCK CURRENT'                           /* lock GUI, gain access      */
  24. OPTIONS FAILAT 6                         /* ignore warnings            */
  25. SIGNAL ON SYNTAX                         /* ensure clean exit          */
  26.  
  27.  
  28. 'REQUEST FILE TITLE "File to UUEncode" PATH Mail:OutBound/'
  29.  
  30. filename = result
  31.  
  32. if rc ~= 5 then do
  33.     filepart = fp(filename)
  34.  
  35. if right(filename,4)~='.lha' then call Archive  /* File-extension ~ .lha */
  36. if right(filename,4)=='.lha' then call Coding   /* File-extension = .lha */
  37.  
  38.  
  39. Archive:
  40.  
  41. 'REQUEST TITLE "Archive" BODY "No LhA-file, I shall fix this ;-)"'
  42.  
  43.   address command
  44.     'Lha -q -y a' "T:" || filepart '"' || filename || '"'
  45.     UUEncode '>T:CodeFile' "T:" || filepart || ".lha" '"' || filepart || .lha'"'
  46.  
  47.   address GOLDED.1 'open insert T:CodeFile'
  48.  
  49.     'Delete >NIL: T:CodeFile'
  50.     'Delete >NIL:' "T:" || filepart || ".lha"
  51. call UNL
  52.  
  53. Coding:
  54.   
  55.   address command
  56.     UUEncode '>T:CodeFile' '"' || filename || '"' '"' || filepart || '"'
  57.  
  58.   address GOLDED.1 'open insert T:CodeFile'
  59.  
  60.     'Delete >NIL: T:CodeFile'
  61. call UNL
  62.  
  63. end
  64.  
  65. UNL:
  66.  
  67. address GOLDED.1 'UNLOCK'                /* VERY IMPORTANT: UNLOCK GUI */
  68.  
  69. EXIT
  70.  
  71. SYNTAX:
  72.  
  73. SAY "Sorry, error line" SIGL ":" ERRORTEXT(RC) ":-("
  74. 'UNLOCK'
  75. EXIT
  76.  
  77. /* ------------- GIVEN A FILENAME, RETURN THE FILEPART --------------- */
  78.  
  79. fp:
  80. parse arg filename
  81. return right(filename, length(filename) - max(lastpos("/", filename),lastpos(":", filename)))
  82.  
  83.